package com.yy.module.entity;

import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.hibernate.annotations.GenericGenerator;
import com.yy.base.common.entity.BaseEntity;

/**
 * 模型
 */
@Entity
@Table(name="t_module")
public class ModuleInfo extends BaseEntity {
	private String id;
	private String parentId;//主模块ID
	private String code;//使用时传入编码
	private String name;//表名
	private String type;//模块类型，编辑页：edit，列表：list,树形结构:tree
	private String layout;//页面布局
	
	private String buttons;//页面按钮，json格式
	private String operations;//数据操作按钮，json格式
	private String clicks;//点击事件、双击，json格式
	
	private Integer pagination = 0;//是否分页，1：是，0：否
	private Integer hideQuery = 0;//是否隐藏查询条件，1：是，0：否
	
	private Integer pageSize = 20;//分页页面大小
	private Integer width;
	private Integer height;
	private String remark;
	private String whereLogic;
	private String sql;
	
	private List<ModuleInfo> children;
	private List<ModuleField> fieldList;
	private List<ModuleQueryField> queryFieldList;

	@Id
	@Column(name="ID", length = 32, nullable = false)
    @GeneratedValue(generator = "uuid2" )//指定生成器名称
    @GenericGenerator(name = "uuid2", strategy = "org.hibernate.id.UUIDGenerator" )
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getParentId() {
		return parentId;
	}
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getLayout() {
		return layout;
	}
	public void setLayout(String layout) {
		this.layout = layout;
	}
	public String getButtons() {
		return buttons;
	}
	public void setButtons(String buttons) {
		this.buttons = buttons;
	}
	public String getOperations() {
		return operations;
	}
	public void setOperations(String operations) {
		this.operations = operations;
	}
	public String getClicks() {
		return clicks;
	}
	public void setClicks(String clicks) {
		this.clicks = clicks;
	}
	public Integer getPagination() {
		return pagination;
	}
	public void setPagination(Integer pagination) {
		this.pagination = pagination;
	}
	public Integer getHideQuery() {
		return hideQuery;
	}
	public void setHideQuery(Integer hideQuery) {
		this.hideQuery = hideQuery;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public Integer getWidth() {
		return width;
	}
	public void setWidth(Integer width) {
		this.width = width;
	}
	public Integer getHeight() {
		return height;
	}
	public void setHeight(Integer height) {
		this.height = height;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getWhereLogic() {
		return whereLogic;
	}
	public void setWhereLogic(String whereLogic) {
		this.whereLogic = whereLogic;
	}
	public String getSql() {
		return sql;
	}
	public void setSql(String sql) {
		this.sql = sql;
	}
	@Transient
	public List<ModuleField> getFieldList() {
		return fieldList;
	}
	public void setFieldList(List<ModuleField> fieldList) {
		this.fieldList = fieldList;
	}
	@Transient
	public List<ModuleQueryField> getQueryFieldList() {
		return queryFieldList;
	}
	public void setQueryFieldList(List<ModuleQueryField> queryFieldList) {
		this.queryFieldList = queryFieldList;
	}
	@Transient
	public List<ModuleInfo> getChildren() {
		return children;
	}
	public void setChildren(List<ModuleInfo> children) {
		this.children = children;
	}
}